import matplotlib.pyplot as plt

"""
few-shot object dectection with anti-confusion grouping 论文画图
"""
def plot_delta_nap():
    # 增加抗混淆模块后的 绝对精度提升 与 样本数 的关系
    x = [1, 2, 3, 5, 10]
    deltas = [2.2, 2.2, 0.4, 0.5, 0.4]
    plt.plot(x, deltas, marker='o', linestyle='dashed')
    plt.xlabel("number of training shots on novel classes")
    plt.ylabel("delta-nAP50")
    plt.show()


def plot_nap_alpha():
    # 检测精度nAP50 与 不信任因子 之间的关系
    x = [0.5, 0.6, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1]
    y = [38.1, 39.2, 40.6, 41, 41.4, 41.6, 41.5, 40.1, 39.4]
    plt.plot(x, y, marker='o', linestyle='dashed')
    plt.xlabel("distrust factor alpha")
    plt.ylabel("nAP50")
    plt.show()


def plot_bin_acc():
    # 检测精度与新类样本数的关系
    x = [1, 2, 3, 5, 10]
    y = [82.6, 87.4, 87.9, 88.6, 92.2]
    plt.plot(x, y, marker='o', linestyle='dashed')
    plt.xlabel("number of training shots on novel classes")
    plt.ylabel("acc")
    plt.show()


if __name__ == '__main__':
    plot_delta_nap()
    # plot_nap_alpha()
    # plot_bin_acc()
